// import { http } from '../utils/request.js';
// 团长
import http from '~/utils/request.js'

let app = getApp();

var url = {
    samplemanag: 'base/ord-sample-acquisition-record/get/fiveCount/sample',
    zhuyinglist: "base/mainCategory/list",
    applytime: "base/applet-head-approve/add",
    addresslist: "head-address/list",
    addaddress: 'head-address/create',
    reqaddress: "head-address",
    updataaddress: "head-address/update",
    deladdress: "head-address/delete",

    ourders: "order/Orders",
    myourders: "myOrder/list",
    orderbyid: "myOrder/byID",

    appletstore: "base/applet-store-follow/add",
    collectrecord: "base/red-collect-record/add",

    cancelOrder: "myOrder/cancelOrder",
    Orderrece: "myOrder/receiving",
    Orderstop: "myOrder/stop",
    Orderabolish: "myOrder/abolish",
    Orderreturn: "myOrder/decline",

    OrderkaiTuan: "myOrder/kaiTuan",

    addfollow: "base/applet-head-follow/add",
banner:"base/applet-banner/get"
}

// adminossfileupload =()=>{
//     return url.admin_oss_file_upload
//   };


let samplemanag = () => {
    return http({
        url: url.samplemanag,
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let zhuyinglist = () => {
    return http({
        url: url.zhuyinglist,
        method: "GET",
        header: {
            'content-type': 'application/json'
        }
    })
}
let applytime = (data) => {
    return http({
        url: url.applytime,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let addresslist = () => {
    return http({
        url: url.addresslist,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let addaddress = (data) => {
    return http({
        url: url.addaddress,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let reqaddress = (data) => {
    return http({
        url: url.reqaddress + "/" + data.addressid,
        settoken: true,
        header: {
            'content-type': 'application/json'
        }
    })
}
let updataaddress = (data) => {
    return http({
        url: url.updataaddress,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let deladdress = (data) => {
    return http({
        url: url.deladdress + "/" + data.id,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let ourders = (data) => {
    return http({
        url: url.ourders,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let myourders = (data) => {
    return http({
        url: url.myourders,
        settoken: true,
        data: data,
        header: {
            'content-type': 'application/json',
        }
    })
}
let orderbyid = (data) => {
    return http({
        url: url.orderbyid,
        settoken: true,
        data: data,
        header: {
            'content-type': 'application/json',
        }
    })
}
let appletstore = (data) => {
    return http({
        url: url.appletstore,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let collectrecord = (data) => {
    return http({
        url: url.collectrecord,
        method: "POST",
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let cancelOrder = (data) => {
    return http({
        url: url.cancelOrder,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let Orderrece = (data) => {
    return http({
        url: url.Orderrece,
        data: data,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let Orderstop = (data) => {
    return http({
        url: url.Orderstop,
        data: data,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let Orderabolish = (data) => {
    return http({
        url: url.Orderabolish,
        data: data,
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let Orderreturn = (data) => {
    return http({
        url: url.Orderreturn,
        data: data,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let OrderkaiTuan = (data) => {
    return http({
        url: url.OrderkaiTuan,
        data: data,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let addfollow = (data) => {
    return http({
        url: url.addfollow,
        data: data,
        method: "POST",
        settoken: true,
        header: {
            'content-type': 'application/json',
        }
    })
}
let banner = (data) => {
  return http({
      url: url.banner,
      data: data,
      method: "GET",
      settoken: true,
      header: {
          'content-type': 'application/json',
      }
  })
}
module.exports = {
    samplemanag,
    zhuyinglist,
    applytime,
    addresslist,
    addaddress,
    reqaddress,
    updataaddress,
    deladdress,
    ourders,
    myourders,
    orderbyid,
    appletstore,
    collectrecord,
    cancelOrder,
    Orderrece,
    Orderstop,
    Orderabolish,
    Orderreturn,
    OrderkaiTuan,
    addfollow,
    banner
}

// export const userLogin = (data) => {
//     // console.log(http)
//     return http({
//       url: '/ipStrainer/createIpFilter',
//       method: 'post',
//       data
//     })
//   }